#ifndef _SERVEUR_H
#define _SERVEUR_H

#define _XOPEN_SOURCE 1

#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h> 
#include <sys/socket.h>
#include <sys/wait.h>
#include <netdb.h>
#include <unistd.h>
#include <string.h>
#include <arpa/inet.h>
#include <pthread.h>
#include <sys/select.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>

#include "code_retour.h"
#include "traitement.h"
#include "config/config.h"
#include "get_index.h"


typedef struct log_client{
  char *ip;
  char *nom;
  char *date_connexion;
  char *requete;
  char *code_retour;
  char *user_agent;
  
}log_client;


extern void  get_page          (int sock,char *requete);
extern void  deconnecter_client(int indice);
extern void  init_log          (struct sockaddr_in* addr,log_client *log);
extern void  rentrer_log       (log_client *log);
extern void  liberer_log       (log_client *log);
extern void  copier_fichier    (int fd_dst,int fd_src);
extern void  get_head          (int isock, char *path);
#endif
